package com.ruoyi.tutors.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.tutors.domain.Tutors;
import org.apache.ibatis.annotations.Select;

/**
 * 导师表Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-13
 */
public interface TutorsMapper extends BaseMapper<Tutors>
{
    /**
     * 查询导师表
     * 
     * @param tutorId 导师表主键
     * @return 导师表
     */
    public Tutors selectTutorsByTutorId(Long tutorId);

    /**
     * 查询导师表列表
     * 
     * @param tutors 导师表
     * @return 导师表集合
     */
    public List<Tutors> selectTutorsList(Tutors tutors);

    /**
     * 新增导师表
     * 
     * @param tutors 导师表
     * @return 结果
     */
    public int insertTutors(Tutors tutors);

    /**
     * 修改导师表
     * 
     * @param tutors 导师表
     * @return 结果
     */
    public int updateTutors(Tutors tutors);

    /**
     * 删除导师表
     * 
     * @param tutorId 导师表主键
     * @return 结果
     */
    public int deleteTutorsByTutorId(Long tutorId);

    /**
     * 批量删除导师表
     * 
     * @param tutorIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTutorsByTutorIds(Long[] tutorIds);

    //根据名称查询数据
    @Select("select * from tutors where tutor_name = #{tutorName}")
    public Tutors selectTutorsByTutorName(String tutorName);


    @Select("SELECT * FROM `tutors` where point_id in (select point_id from expert_assignments where expert_id = #{userId})")
    List<Tutors> selectByExpert(Long userId);
}
